<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>{$stitle}-第{$_GET['page']?$_GET['page']:1}页-动态-{$config_sitename}</title>
    <link rel="stylesheet" href="__CSS__/global.css" />
    <link rel="stylesheet" href="__CSS__/dongtai.css" />
    <Admintemplate file="Home/Public/global_js"/>
    <script src="__JS__/jquery.min.js"></script>
</head>

<body>

<div class="b-page">
    <include file="Public:header" />

    <a href="{$midad.linkurl}" class="b-banner_big" style="background-image: url(__FILESURL__{$midad.image});">{$midad.title}</a>
    <div class="b-dongtai">
        <div class="b-body l-center">
            <div class="b-dongtaiTitle">按照烘焙配方，秀出您的作品</div>
            <div class="b-dongtaiTabList">
                <a href="__WEBURL__/dongtai" class="b-dongtaiTab {$newact}">最新上传</a>
                <a href="__WEBURL__/dongtai/liuxin" class="b-dongtaiTab {$liuxinact}">正在流行</a>
                <a href="__WEBURL__/dongtai/zuijia" class="b-dongtaiTab {$zuijiaact}">24小时最佳</a>
            </div>
            <div class="b-dongtaiItemList">

                <foreach name="list" item="vo">

                <div class="b-dongtaiItem">
                    <div class="b-dongtaiItem__top">
                        <div class="b-dongtaiItem__pic">
                            <img class="l-full" src="__FILESURL__{$vo.image}">
                            <div class="b-itemMask">
                                <if condition="$userinfo.userid neq ''">
                                <if condition="$vo.dignum eq 0">
                                <a class="b-itemMask__zan R_ajax_dig" data-info="infoid,{$vo.workid}~digtype,1" data-url="do/adddig/"><i class="b-popOtherZuopin__itemMask undig"></i></a>
                                    <else/>
                                    <a class="b-itemMask__zan R_ajax_dig" data-info="infoid,{$vo.workid}" data-url="do/canceldig/"><i class="b-popOtherZuopin__itemMask digged"></i></a>
                                </if>
                                <else/>
                                    <a class="b-itemMask__zan R_ajax_dig" data-info="infoid,{$vo.workid}~digtype,1" data-url="do/adddig/"><i class="b-popOtherZuopin__itemMask undig"></i></a>
                                </if>
                            </div>
                        </div>
                        <div class="b-dongtaiItem__title"><a href="__WEBURL__/works/{$vo.workid}" title="{$vo.title}">{$vo.title|str_cut=15}</a></div>
                        <div class="b-dongtaiItem__content">{$vo.content|str_cut=75}</div>
                        <div class="b-dongtaiItem__info">
                            <div class="b-dongtaiItem__time">{$vo.create_time|format_time}</div>
                            <div class="b-dongtaiItem__pinglun"><i class="b-messageIcon pic_mid"></i><span>{$vo.msgnum}</span></div>
                            <div class="b-dongtaiItem__zan"><i class="b-dingIcon pic_mid"></i><span>{$vo.goodnum}</span></div>
                        </div>
                    </div>
                    <div class="b-dongtaiItem__bottom">
                        <div class="ofh">
                            <div class="b-dongtaiItem__user"><a href="__WEBURL__/u/{$vo.openuid}"><img src="{$vo.uavatar|getUavatar}" class="pic_mid"><span>{$vo.nickname}</span></a></div>
                            <div class="b-dongtaiItem__addr"><if condition="$vo.ifrz eq 1"><a href="__WEBURL__/us/renzheng.html"><i class="b-renzhengIcon pic_mid"></i></a></if>
                                <if condition="$vo.uprovince gt 0"><span>{$vo.uprovince|showProvince},{$vo.ucity|showCity}</span></if></div>
                        </div>
                    </div>
                </div>

                </foreach>

            </div>
            <div class="clear"></div>
            <if condition="$pagecount gt 1">
            <div class="pager">{$Page}</div>
            </if>

        </div>

    </div>

    <include file="Public:footer" />
</div>

<script src="__JS__/index.js"></script>
<script src="__JS__/jquery.common.js?v=20150101"></script>
<script src="__JS__/jquery.doajax.js"></script>

<script>
    $(document).ready(function(){
        $('.b-dongtaiItem').each(function(i,val){
            if(i%3==0) $(this).addClass('b-dongtaiItem_first');
        });
        $('.b-dongtaiItem__pic').hover(function(){
            $(this).find('.b-itemMask').stop(true,true).fadeIn();
        },function(){
            $(this).find('.b-itemMask').stop(true,true).fadeOut();
        });

        $(".b-dongtaiItem__pic img").each(function(i){
            var img = $(this);
            var realWidth;//真实的宽度
            var realHeight;//真实的高度
            //这里做下说明，$("<img/>")这里是创建一个临时的img标签，类似js创建一个new Image()对象！
            $("<img/>").attr("src", $(img).attr("src")).load(function() {
                realWidth = this.width;
                realHeight = this.height;
                if(realHeight>400){
                    var margintop=(realHeight/2-200)/2;
                    img.css('marginTop','-'+margintop+'px');
                }
            });
        });

    });
</script>
</body>
</html>